//百度地图
$(function() {
	$( "#mapBox" ).dialog({
		autoOpen: false,
		resizable: false,
		width: 600,
		height: 600,
		title : "查看地址全图",
		modal : true,
		position:["center","top"]
	});

	$(".baidu-map").each(function(){
		var address = $(this).attr("data-address");
		$(this).click(function(){
			$("#mapBox").dialog("open");
			var map = new BMap.Map("mapBox");  
			map.centerAndZoom(address, 15);
			map.enableScrollWheelZoom();  // 开启鼠标滚轮缩放  
			map.enableKeyboard();         // 开启键盘控制  
			map.enableContinuousZoom();   // 开启连续缩放效果  
			map.enableInertialDragging(); // 开启惯性拖拽效果  
			map.addControl(new BMap.NavigationControl());  
			map.addControl(new BMap.ScaleControl());  
			map.addControl(new BMap.OverviewMapControl());  
			map.addControl(new BMap.MapTypeControl());  

			var local = new BMap.LocalSearch(map, {
			  renderOptions: {map: map, panel: "results"}
			});
			local.search(address);
			return false;
		});
	});
	// var getAddress = function(city){
		// $(".baidu-map").each(function(){
			// city = this.data-address;
			// return city;
		// });
	// };
});